<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>订单详情</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <!--签到-->
    <link href="Content/wechat/css/dangJian_gongZhuGongJian_CJHD.css" rel="stylesheet" type="text/css">

    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--上传图片js-->
    <script src="Content/wechat/js/svg.js"></script>
    <!--end 上传图片js-->
</head>
<body>

<div class="xinyuan">
    <div class="xinyuan_box">
        <h4>商品图片</h4>
        <img src="${orderInfo.rows[0].imgUrl!}"/>
        <dl class="clearfix">
            <dt>商品名称</dt>
            <dd>
                <input class="text" type="text" readonly="readonly" value="${orderInfo.rows[0].name!}"
                       placeholder="请输入活动名称">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>使用积分</dt>
            <dd>
                <input class="text" type="text" readonly="readonly" value="${orderInfo.rows[0].num!}"
                       placeholder="请输入报名人数">
            </dd>
        </dl>
        <dl class="clearfix">
            <dt>订单状态</dt>
            <dd>
                <input class="text" type="text" id="status" readonly="readonly" value="" placeholder="请输入报名人数">
            </dd>
        </dl>

        <h4>订单备注：</h4>
        <textarea class="textarea" style="height: 1rem;" readonly="readonly" placeholder="请简要说明">${orderInfo.rows[0].content!}</textarea>
        <h4>收货地址：</h4>
        <textarea class="textarea" style="height: 1rem;" readonly="readonly" placeholder="请简要说明">${orderInfo.rows[0].address!}</textarea>
        <h4 class="noShow">发货备注：</h4>
        <textarea class="textarea noShow" style="height: 1rem;" readonly="readonly" placeholder="请简要说明">${orderInfo.rows[0].fhcontent!}</textarea>


    </div>
    <div class="button_shangChuan noShow1" onclick="btnOver()">确认收货</div>
</div>


</body>
<script>
    var status =${orderInfo.rows[0].status!};
    if (status == "1") {
        $(".noShow").hide();
        $(".noShow1").hide();
        $("#status").val("已经下单");
    }

    if (status == "2") {
        $("#status").val("已经发货");
    }
    if (status == "3") {
        $(".noShow1").hide();
        $("#status").val("订单完成");
    }

    function btnOver(){
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "/wechat/personage/isVoer",//url
            data: {id:'${orderInfo.rows[0].id!}'},
            success: function (result) {
                console.log(result);//打印服务端返回的数据(调试用)
                if (result.code == 200) {
                    alert(result.info);
                    window.location.href='/wechat/personage/order_list';
                } else {
                    alert("请稍后再试");
                }
            },
            error: function () {
                alert("异常！");
            }
        });
    }
</script>
</html>